home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Original Code / Taming the Mouse / EvenBetterBlockOut / CaptureLossNotifyWindow.cs next >
Encoding:
Text File  |  2001-01-15  |  632 b   |  25 lines

  1. //------------------------------------------------------
  2. // CaptureLossNotifyWindow.cs ⌐ 2001 by Charles Petzold
  3. //------------------------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7.  
  8. interface ICaptureLossNotify
  9. {
  10.      void OnLostCapture();
  11. }
  12.  
  13. class CaptureLossNotifyWindow: NativeWindow 
  14. {
  15.      public ICaptureLossNotify control;
  16.  
  17.      protected override void WndProc(ref Message message) 
  18.      {
  19.           if (message.Msg == 533)                 // WM_CAPTURECHANGED
  20.                control.OnLostCapture();
  21.  
  22.           base.WndProc(ref message);
  23.      }
  24. }
  25.